<?php

namespace App\Model;

class FinanceWallet extends BaseModel
{
    protected $table = 'finance_wallet';
    public $timestamps = false;

    public function number(){
        return $this->belongsTo('App\Model\Number','user_id','user_id');
    }
    
    public function getKkBalanceByUserId(int $user_id){
        return self::where('user_id', $user_id)->first(['kk_balance']);
    }


    //更新
    public function updateData($data)
    {
        return curl_request(getKkaudioApiUrl() . '/inner/finance/wallet/update', $data, 'urlencoded', 'GET');
    }


}
